#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
int main()
{
	int n, m = 0, a = 0, b = 0;
	scanf("%d", &n);
	for (int i = pow(10, n - 1); i < pow(10, n); i++)
	{
		m = 0;
		for (int j = 0; j < n; j++)
		{
			a = i - i / (int)pow(10, n - j) * (int)pow(10, n - j);
			m += (int)pow(a / (int)pow(10, n - j - 1), n);
		}
		if (i == m)
		{
			printf("%d\n", i);
			b++;
		}
	}
	if (b == 0)printf("No output.\n");
	return 0;
}